# LuckPay Web Manage System
#
# Copyright (c) 2016 Lucky Byte, Inc.
#
$ ->
    form = $('form.main')
    form.form
        inline : true,
        fields :
            bin_num           : 'empty',
            issuer_code       : 'empty',
            issuer_name       : 'empty',
            card_name         : 'empty',
            debit_credit_flag : 'empty',
            bin_len           : 'empty',
            card_no_len       : 'empty',


    $('#search').click(() ->
        $.post('/p2/blacklist/cardbin', {
            bin_num: $("input[name='bin_num']").val()
        }, (data) ->
            console.log data.cardbin
            cardbin = JSON.parse data.cardbin
            if data.succ
              form.form('set values', cardbin)
        )
    )
